<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
          /* perspective:500px ; */
        }
        .box{position: relative;
            width: 100px;
            height: 100px;
            margin: 0 auto;
            transition: all 2s;
            transform-style:preserve-3d;
            animation: move 3s linear infinite alternate;
            perspective:500px ;


        }
        .box div{
            height: 100%;
            width: 100%;
            position: absolute;
            left: 0;
            top: 0;

        }
        .box div:first-child{
            background-color: pink;
        }
        .box div:last-child{
            background-color:yellow;
            transform: rotateX(45deg);

        }
        /* .box:hover{
            transform: rotateY(60deg);

        } */
        @keyframes move{
            100%{
                transform: rotateY(360deg);
            }
        }


    </style>
</head>
<body>
    <div class="box">
        <div></div>
        <div></div>

    </div>
</body>
</html>